<?php
class MantenimientosController extends AppController {

	var $name = 'Mantenimientos';
	var $uses = array('Vehiculo', 'MantPrev');
	var $helpers = array('Html', 'Form' , 'fpdf');

	function beforeFilter() {
		$this->checkSession();
		$this->MenuCreator->setModulo($this->name);
		$this->set('menu', $this->getMenuElements());		
	}

	function generar_reporte(){
		$this->set('mantenimientos', $this->MantPrev->obtenerMantenimientoPreventivo());	
	}
	
	function indexPdf(){		
		$this->layout = 'pdf';
		$this->set('mantenimientos', $this->MantPrev->obtenerMantenimientoPreventivo());
		$this->render();
	}
	
	function index(){
		$this->set('mantenimientos', $this->paginate());
	}
}
?>